/*
 * \brief Accelerometer module
 * stm_acc.h
 *
 *  Created on: 29-03-2013
 *      Author: Podol
 */

#ifndef STM_ACC_H_
#define STM_ACC_H_

#include "stm32f4xx.h"
#include <stdint.h>


/*
+=============================================================================+
| global definitions
+=============================================================================+
*/
#define SPI_ACC					 SPI1

/*------------------------------------------------------------------------*//**
* \brief Internal regisers addresses
* \details
*
*//*-------------------------------------------------------------------------*/
#define X_AXIS				 0xA900
#define Y_AXIS				 0xAB00
#define Z_AXIS				 0xAD00

#define ACC_activ_reg     	 	 0x2047
#define Who_Am_I				 0x8F00


/*------------------------------------------------------------------------*//**
* \brief Structure to keep results get from ACC
* \details
*
*//*-------------------------------------------------------------------------*/
typedef struct
{
	uint16_t x_axis;
	uint16_t y_axis;
	uint16_t z_axis;
} acc_axes_res;

/*
+=============================================================================+
| functions
+=============================================================================+
*/

/*------------------------------------------------------------------------*//**
* \brief Initialize the accelerometer
* \details
*
* \param (void)
*//*-------------------------------------------------------------------------*/
void acc_init( void );



#endif /* STM_ACC_H_ */
